from prettytable import PrettyTable

class PrettyTableUtil:
    pt = ''
    def __init__(self,fieldnames):
        self.pt = PrettyTable()
        self.pt.field_names = fieldnames

    def addRow(self,info):
        self.pt.add_row(info)

    def renderTable(self,sortby=''):
        if sortby:
            self.pt.get_string(sortby=sortby)
        return self.pt

